package types

import (
	"insighttracking/common/types"
)

type CreateMealsReq struct {
	Describe  string       `json:"describe,optional"`
	Meals     []MealsModel `json:"meals"`
	Name      string       `json:"name"`
	StartDate string       `json:"startDate" validate:"checkDate"`
	EndDate   string       `json:"endDate" validate:"checkDate"`
}

type MealsModel struct {
	Date      string  `json:"date" validate:"checkDate"` // 日期
	DishesIDs []int64 `json:"dishes_ids"`                // 菜品ID集合
	Type      int64   `json:"type"`                      // 餐类型 1-早 2-中 3-晚
	Weekday   int64   `json:"weekday"`                   // 周几 1-7
}

type MealsTemplateResp struct {
	List []MealsTemplateModel `json:"list"`
}

type MealsTemplateModel struct {
	ID        int64  `json:"id"`
	Name      string `json:"name"`
	Describe  string `json:"describe"`
	StartDate int64  `json:"start_date"`
	EndDate   int64  `json:"end_date"`
	CreatedAt int64  `json:"created_at"`
	UpdatedAt int64  `json:"updated_at"`
}

type MealsTemplateDetailResp struct {
	Name      string               `json:"name"`
	Describe  string               `json:"describe"`
	StartDate int64                `json:"start_date"`
	EndDate   int64                `json:"end_date"`
	Meals     []*types.MealsDetail `json:"meals"`
}

type MealsTemplateEditReq struct {
	TemplateID int64        `json:"template_id"`
	Name       string       `json:"name"`
	Describe   string       `json:"describe,optional"`
	Meals      []MealsModel `json:"meals"`
	StartDate  string       `json:"start_date" validate:"checkDate"`
	EndDate    string       `json:"end_date" validate:"checkDate"`
}

type MealsTemplateApplyResp struct {
	TemplateID  int64   `json:"template_id"`
	CusTomerIDs []int64 `json:"customer_ids"`
}

type CustomerMealsEditReq struct {
	CusTomerID int64        `json:"customer_id"`
	Meals      []MealsModel `json:"meals"`
}

type CustomerMealsListReq struct {
	ID        int64  `json:"id" validate:"required"`          // 主键id
	StartDate string `json:"start_date" validate:"checkDate"` // 开始时间
	EndDate   string `json:"end_date" validate:"checkDate"`   // 结束时间

}
type CustomerMealsListResp struct {
	Meals []*types.MealsDetail `json:"meals"`
}

type TemplateListReq struct {
	Name string `form:"name,optional"`
}
